home *** CD-ROM | disk | FTP | other *** search
- Subject: Re:FW_CSharedLibraryResourceFile
- Sent: 6/3/96 8:21 AM
- Received: 6/3/96 8:41 AM
- From: Greg Friedman, friedman@cognosis.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- At 11:12 PM 6/2/96, Hutchings Software Development wrote:> If I allocate a
- FW_CSharedLibraryResourceFile with the constructor that
- > just passes the Environment* parameter, is that guaranteed to open access
- > to the part editor's shared library?
- >
- > That piece of info was missing from ODF Assistant in QuickView.
- >
- > I need to know this because I'm writing a general utility routine for
- > "CustomGetFolder", and I need acces to my part editor's resource fork,
- > hopefully without passing an FW_Instance parameter all over the place.
- >
- > Thanks,
- >
- > Brad
-
- Brad,
-
- As you well know by now, dealing with Macintosh resources in the OpenDoc
- world is confusing. Now I'll make it more confusing. Think of
- FW_CSharedLibraryResourceFile as a file specifier. That's really all that
- it is. Once you've created a FW_CSharedLibraryResourceFile, you can pass it
- to any interface that accepts a FW_PResourceFile. Most resource access in
- ODF parts is accomplished by calling the resource acquisition utilities
- that expect an FW_PResourceFile. Resource acquisition methods dynamically
- adjust the Macintosh resource chain, putting your parts resource fork at
- the head of the chain only when you attempt to get a resource. This is so
- because all parts living in a single document share the same resource
- chain, and we do our best to prevent collisions.
-
- It sounds to me like what you are doing is a bit different. I suspect you
- want to call the toolbox Standard File package, and pass the resource id of
- your custom get file dialog. You've probably noticed that the toolbox
- interfaces don't take FW_PResourceFile parameters. Creating an
- FW_CLibrarySharedResourceFile before calling the toolbox interfaces will
- have no effect, and you're likely to get unexpected behavior.
-
- In this case, you need to create a stack-based instance of
- FW_CAcquireCFMResourceAccess. Creating one of these on the stack is similar
- to calling UseResFile. FW_CAcquireCFMResourceAccess's destructor will take
- care of cleanup and is exception safe. Just make sure you scope your code
- such that your FW_CAcquireCFMResourceAccess falls out of scope and is
- destroyed before you attempt to call any OpenDoc or ODF methods that might
- try to get to resources.
-
- gsf.
-
-
-
- _________________________________________________________
- Greg Friedman ODF Engineering Apple Computer
-
-